<template>
  <div class="app-container">

    <div style=" position: fixed;
            height: 3rem;
            width: 100%;
            right: 0;
            top: 0;
            z-index: 999;//一直将导航栏置于最顶层
            background-color: white; //设置导航栏背景颜色"
    >

    </div>
    <el-main style="">
<!--      <div v-if="!showList" style="width: 70%">-->
<!--        <NoteCard :item="item" :key="i" v-for="(item,i) in cartList" style="float: top;"></NoteCard>-->
<!--        <pagination-->
<!--          v-show="total>0"-->
<!--          :total="total"-->
<!--          :page.sync="queryParams.pageNum"-->
<!--          :limit.sync="queryParams.pageSize"-->
<!--          @pagination="getList"-->
<!--        />-->
<!--      </div>-->

      <div class="tile-button-container">
        <div
          v-for="(item, index) in buttonList"
          :key="index"
          class="tile-button"
          @click="handleClick(item)"
        >
          <i :class="item.icon" class="button-icon"></i>
          <span class="button-text">{{ item.text }}</span>
        </div>
      </div>
    </el-main>
  </div>
</template>

<script>
// import {addNote, delNote, getNote, getTreeList, listNote, updateNote} from '@/api/note/note'
// import {listData} from '@/api/system/dict/data'
// import Dict from '@/views/system/dict'
// import menuPart from './../components/floatMenu/menuPart'
// import HelloWorld from './../components/floatMenu/HelloWorld.vue'
// import floatBtn from './../components/floatMenu/floatBtn.vue'
// import music from './../../src/views/note/note/music'
// import CollapseBread from './../../src/views/note/note/CollapseBread'
// import NoteCard from './../../src/views/note/note/NoteCard'

export default {
  name: 'Index',
  // components: {Dict, menuPart, HelloWorld, floatBtn, music, CollapseBread, NoteCard},
  data() {
    return {

      buttonList: [
        {
          text: '首页',
          icon: 'el-icon-house',
          path: '/'
        },
        {
          text: '笔记',
          icon: 'el-icon-notebook-2',
          path: '/note'
        },
        {
          text: '合集',
          icon: 'el-icon-collection',  // 或 el-icon-folder
          path: '/note/compilation/Compilation'
        },{
          text: 'anki卡片解析',
          icon: 'el-icon-setting',
          path: '/anki'
        },
        {
          text: '个人中心',
          icon: 'el-icon-user',
          path: '/user/profile'
        }
      ],


    }
  },
  created() {

  },
  mounted() {
    window.addEventListener('mousemove', this.handleMouseMove);
  },
  methods: {
    handleClick(item) {
      // 跳转到指定路径
      this.$router.push(item.path);
      // 或者使用 window.location.href = item.path;
    }
  }, handleMouseMove(e) {
  const x = (window.innerWidth - e.pageX * 2) / 50;
  const y = (window.innerHeight - e.pageY * 2) / 50;
  document.querySelector('.app-container').style.backgroundPosition =
    `${x}px ${y}px`;
},
  beforeDestroy() {
    window.removeEventListener('mousemove', this.handleMouseMove);
  }
}
</script>

<style scoped lang="scss">
.tile-button-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); /* 放大三倍 */
  gap: 60px; /* 放大三倍 */
  padding: 60px; /* 放大三倍 */
}

.tile-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 360px; /* 放大三倍 */
  background: #ffffff;
  border-radius: 24px; /* 放大三倍 */
  box-shadow: 0 6px 36px 0 rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative; /* 为文字悬停展示做准备 */

  &:hover {
    transform: translateY(-6px); /* 放大三倍 */
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.15);
  }
  .button-icon {
    font-size: 72px; /* 放大三倍 */
    color: #409EFF;
  }

  .button-text {
    font-size: 24px; /* 放大三倍 */
    color: #333333;
    position: absolute;
    bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
}

.tile-button:hover .button-text {
  opacity: 1;
}


</style>

